package org.mogu.control.model;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

public class IMUser implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String uname=null;
	private String unicename=null;
	private int header=0;
	public int getHeader() {
		return header;
	}
	public void setHeader(int header) {
		this.header = header;
	}
	private String sex=null;
	private String city=null;
	private String sheng=null;
	private String birthday=null;
	public String getBirthday() {
		return birthday;
	}
	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}
	private String desc=null;
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	private String code=null;
	private String father=null;
	private String title=null;
	private String replyType=null;
	private String maincode=null;
	private String level=null;
	private String lastUpdateTime=null;
	private String content=null;
	
	private int id=0;
	private int count=0;
	private int var=0;
	
	private boolean hascount=false;
	
	
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getFather() {
		return father;
	}
	public void setFather(String father) {
		this.father = father;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getReplyType() {
		return replyType;
	}
	public void setReplyType(String replyType) {
		this.replyType = replyType;
	}
	public String getMaincode() {
		return maincode;
	}
	public void setMaincode(String maincode) {
		this.maincode = maincode;
	}
	public String getLevel() {
		return level;
	}
	public void setLevel(String level) {
		this.level = level;
	}
	public String getLastUpdateTime() {
		return lastUpdateTime;
	}
	public void setLastUpdateTime(String lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
		try {
			JSONObject user=new JSONObject(content);
			this.uname=user.getString("username");
			this.unicename=user.getString("nickname");
			this.birthday=user.getString("birthday");
			this.sheng=user.getString("sheng");
			this.city=user.getString("city");
			this.sex=user.getString("sex");
			this.desc=user.getString("desc");
			if(user.has("header")){
				this.header=user.getInt("header");
			}
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
	}
	public String getUname() {
		return uname;
	}
	public void setUname(String uname) {
		this.uname = uname;
	}
	public String getNicename() {
		return unicename;
	}
	public String getUnicename() {
		return unicename+"("+uname+")";
	}
	public void setUnicename(String unicename) {
		this.unicename = unicename;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getSheng() {
		return sheng;
	}
	public void setSheng(String sheng) {
		this.sheng = sheng;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public boolean isHascount() {
		return hascount;
	}
	public void setHascount(boolean hascount) {
		this.hascount = hascount;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public int getVar() {
		return var;
	}
	public void setVar(int var) {
		this.var = var;
	}
}
